titol
Home Wordpress            

18.MAKE VTUOR(MULTIRES)の.xmlの変更

KrpanoToolのMAKE VTUOR(MULTIRES)dropletを用いて生成される.xmlを変更することにより、アイコンやサムネールやradarを付加することが出来る。

1.MAKE VTUOR(MULTIRES)dropletは、複数枚のEquirectangularの画像をドロップするだけでサムルール付きのTuorを組んでくれる、ただし画面操作のアイコンは組み込まれていない。アニメhotspotはコメントで書き込んでくれている。ましてや、plugin類は組み込まれていない。

2.またMAKE VTUOR(MULTIRES)dropletは、2枚のcylindaicalの画像のTuorまでなら生成してくれる。ただし横幅があまりにも大きいとエラーが発生する。

3.そこで、今回は1.のTuorにアイコンを仕込むことをテストする。

4.6-17で作成した.xmlの記述を抜き出し、2.で作成した.xmlに組み込み、Tuorを組み立てる。

5.まずは1.で作成した.xmlをエディターで見て下さい。下記とは少し異なりますが、一度全体を見ておくと、後で役に立ちます。
1
2
3

4

5

6

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26

27

28
6.以上が全てではないが、1,000行程それぞれに意味があるが、現在わかる範囲で、注釈をいれてみた。詳しくは「Krpano」のサイトに詳しい解説がある。
7.これをそぎ落として、かつアイコンや必要な物を組み込んでいく。おおむね下記の構成の様に組み直す。細かい定義も移植するのですが、大骨を示しておきます。

31

32
33
34

8.それぞれ整理すると、細かい定義も含めてモジュール化(パーツ化)した物を彫り込むだけで、再構成できます。

x1

x2

x4

x5
x6

9.操作アイコンの構文

<!-- -----------controlアイコンの前置き ------------------- -->
<events onxmlcomplete="setuppano();"
onpreviewcomplete=""
onloadcomplete=""
onloaderror=""
onkeydown=""
onkeyup=""
onclick=""
onmousedown=""
onmouseup=""
onmousewheel=""
onidle=""
onviewchange=""
onresize=""
onenterfullscreen="set(plugin[openfs].visible,false);
set(plugin[closefs].visible,true);
if(isandroid, set(plugin[android_openfs].visible,false); set(plugin[android_closefs].visible,true); );
"
onexitfullscreen="set(plugin[openfs].visible,true);
set(plugin[closefs].visible,false);
if(isandroid, set(plugin[android_openfs].visible,true); set(plugin[android_closefs].visible,false); );
"
/>
<!-- --------controlアイコンの前置き ここまで -------------- -->

<!-- ---------------------------controlアイコン ------------------- -->
<control usercontrol ="all"
mousetype ="moveto"
zoomtocursor ="false"
zoomoutcursor ="true"
mouseaccelerate="1.00"
mousespeed ="10.00"
mousefriction ="0.80"
headswing ="0.00"
keybaccelerate ="0.50"
keybspeed ="10.00"
keybfriction ="0.90"
keybinvert ="false"
mousefovchange ="1.00"
keybfovchange ="0.75"
fovspeed ="3.00"
fovfriction ="0.90"
movetocursor ="none"
cursorsize ="10.0"
keycodesleft ="37"
keycodesright ="39"
keycodesup ="38"
keycodesdown ="40"
keycodesin ="16,65,107"
keycodesout ="17,89,90,109"
/>

<contextmenu fullscreen="true">
<item name="n0" enabled="true" visible="true" separator="false"
caption="KRPANO"
onclick=""
/>
<item name="n1" enabled="true" visible="true" separator="false"
caption="FULLSCREEN"
onclick=""
/>
<item name="n2" enabled="true" visible="true" separator="true"
caption="normal view"
onclick="action(view_normal);"
/>
</contextmenu>

<textstyle name="default" font="Times" fontsize="12" bold="true" italic="false"
textcolor="0" background="true" backgroundcolor="16777215" border="true" bordercolor="0"
alpha="1" blendmode="normal" effect=""
origin="cursor" edge="bottom" textalign="none" xoffset="0" yoffset="-3" noclip="true" showtime="0.1" fadetime="0" fadeintime="0"
/>
<textstyle name="buttonstyle" font="Arial" fontsize="12" bold="true" italic="true"
textcolor="0" background="false" backgroundcolor="16777215" border="false" bordercolor="0"
alpha="1" blendmode="layer" effect="glow(0xFFFFFF,0.85,4,4);dropshadow(2,45,0x000000,4,1);"
origin="cursor" edge="bottom" textalign="none" xoffset="15" yoffset="-5" noclip="true" showtime="0.1" fadetime="0.1" fadeintime="0.1"
/>

<action name="dragcursor">
set(plugin[dragmode].visible, false);
set(plugin[movemode].visible, true);
set(control.mousetype, drag2D);
set(cursors.url, %SWFPATH%/skin/drag-cursors.png);
set(cursors.type, drag);
set(cursors.move, 2|0|30|32);
set(cursors.drag, 37|0|30|32);
</action>

<action name="qtvrcursor">
set(plugin[dragmode].visible, true);
set(plugin[movemode].visible, false);
set(control.mousetype, moveto);
set(cursors.url, %SWFPATH%/skin/qtvr-cursors.png);
set(cursors.type, 8way);
set(cursors.move, 0|0|16|16);
set(cursors.drag, 16|0|16|16);
set(cursors.arrow_u, 32|0|16|16);
set(cursors.arrow_d, 48|0|16|16);
set(cursors.arrow_l, 64|0|16|16);
set(cursors.arrow_r, 80|0|16|16);
set(cursors.arrow_lu, 96|0|16|16);
set(cursors.arrow_ru, 112|0|16|16);
set(cursors.arrow_rd, 128|0|16|16);
set(cursors.arrow_ld, 144|0|16|16);
</action>

<action name="view_normal">
tween(view.fovmax, 150.0, distance(179, 1.00), easeoutquad);
tween(view.architectural, 0.0, distance(1.0, 0.45), easeoutquad);
tween(view.fisheye, 0.0, distance(1.0, 0.45), easeoutquad, set(view.stereographic,false); set(view.pannini,false); set(display.flash10,on); );
</action>

<action name="setuppano">
action(qtvrcursor);
if(ispartialpano === true, set(showviewitems,false), set(showviewitems,true));
set(contextmenu.item[2].visible, get(showviewitems));
set(contextmenu.item[3].visible, get(showviewitems));
set(contextmenu.item[4].visible, get(showviewitems));
set(contextmenu.item[5].visible, get(showviewitems));
set(contextmenu.item[6].visible, get(showviewitems));
set(contextmenu.item[7].visible, get(showviewitems));
</action>

<style name="button" keep="true" url="skin/%SWFPATH%/skin/buttons.png" />

<plugin name="openfs"
url="skin/%SWFPATH%/skin/buttons.png"
keep="true" preload="false"
visible="true" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="0"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="bottom" edge=""
x="+160" y="10" ox="" oy=""
width="40" height="40"
crop="280|0|40|40" ondowncrop="280|80|40|40" onovercrop="280|40|40|40"
scale="1" scale9grid="" scalechildren="false"
rotate="0"
parent=""
mask=""
onloaded=""
onover=""
onhover="showtext(Fullscreen, buttonstyle);"
onout=""
ondown=""
onup=""
onclick="set(fullscreen,true);"
devices="desktop|tablet"
/>

<plugin name="in"
url="skin/%SWFPATH%/skin/buttons.png"
keep="true" preload="false"
visible="true" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="0"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="bottom" edge=""
x="-160" y="10" ox="" oy=""
width="40" height="40"
crop="160|0|40|40" ondowncrop="160|80|40|40" onovercrop="160|40|40|40"
scale="1" scale9grid="" scalechildren="false"
rotate="0"
parent=""
mask=""
onloaded=""
onover=""
onhover=""
onout=""
ondown="set(fov_moveforce,-1);"
onup="set(fov_moveforce,0);"
onclick=""
devices="desktop|tablet"
/>

<plugin name="out"
url="skin/%SWFPATH%/skin/buttons.png"
keep="true" preload="false"
visible="true" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="0"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="bottom" edge=""
x="-120" y="10" ox="" oy=""
width="40" height="40"
crop="200|0|40|40" ondowncrop="200|80|40|40" onovercrop="200|40|40|40"
scale="1" scale9grid="" scalechildren="false"
rotate="0"
parent=""
mask=""
onloaded=""
onover=""
onhover=""
onout=""
ondown="set(fov_moveforce,+1);"
onup="set(fov_moveforce,0);"
onclick=""
devices="desktop|tablet"
/>

<plugin name="left"
url="skin/%SWFPATH%/skin/buttons.png"
keep="true" preload="false"
visible="true" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="0"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="bottom" edge=""
x="-80" y="10" ox="" oy=""
width="40" height="40"
crop="0|0|40|40" ondowncrop="0|80|40|40" onovercrop="0|40|40|40"
scale="1" scale9grid="" scalechildren="false"
rotate="0"
parent=""
mask=""
onloaded=""
onover=""
onhover=""
onout=""
ondown="set(hlookat_moveforce,-1);"
onup="set(hlookat_moveforce,0);"
onclick=""
devices="desktop|tablet"
/>

<plugin name="right"
url="skin/%SWFPATH%/skin/buttons.png"
keep="true" preload="false"
visible="true" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="0"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="bottom" edge=""
x="-40" y="10" ox="" oy=""
width="40" height="40"
crop="40|0|40|40" ondowncrop="40|80|40|40" onovercrop="40|40|40|40"
scale="1" scale9grid="" scalechildren="false"
rotate="0"
parent=""
mask=""
onloaded=""
onover=""
onhover=""
onout=""
ondown="set(hlookat_moveforce,+1);"
onup="set(hlookat_moveforce,0);"
onclick=""
devices="desktop|tablet"
/>

<plugin name="up"
url="skin/%SWFPATH%/skin/buttons.png"
keep="true" preload="false"
visible="true" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="0"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="bottom" edge=""
x="+0" y="10" ox="" oy=""
width="40" height="40"
crop="80|0|40|40" ondowncrop="80|80|40|40" onovercrop="80|40|40|40"
scale="1" scale9grid="" scalechildren="false"
rotate="0"
parent=""
mask=""
onloaded=""
onover=""
onhover=""
onout=""
ondown="set(vlookat_moveforce,-1);"
onup="set(vlookat_moveforce,0);"
onclick=""
devices="desktop|tablet"
/>

<plugin name="down"
url="skin/%SWFPATH%/skin/buttons.png"
keep="true" preload="false"
visible="true" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="0"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="bottom" edge=""
x="+40" y="10" ox="" oy=""
width="40" height="40"
crop="120|0|40|40" ondowncrop="120|80|40|40" onovercrop="120|40|40|40"
scale="1" scale9grid="" scalechildren="false"
rotate="0"
parent=""
mask=""
onloaded=""
onover=""
onhover=""
onout=""
ondown="set(vlookat_moveforce,+1);"
onup="set(vlookat_moveforce,0);"
onclick=""
devices="desktop|tablet"
/>

<plugin name="quality"
url="skin/%SWFPATH%/skin/buttons.png"
keep="true" preload="false"
visible="true" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="0"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="bottom" edge=""
x="+80" y="10" ox="" oy=""
width="40" height="40"
crop="240|0|40|40" ondowncrop="240|80|40|40" onovercrop="240|40|40|40"
scale="1" scale9grid="" scalechildren="false"
rotate="0"
parent=""
mask=""
onloaded=""
onover=""
onhover="showtext(Toggle Quality, buttonstyle);"
onout=""
ondown=""
onup=""
onclick="switch(display.flash10,on,off);invalidatescreen();"
devices="desktop|tablet"
/>

<plugin name="dragmode"
url="skin/%SWFPATH%/skin/buttons.png"
keep="true" preload="false"
visible="true" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="0"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="bottom" edge=""
x="+120" y="10" ox="" oy=""
width="40" height="40"
crop="400|0|40|40" ondowncrop="400|80|40|40" onovercrop="400|40|40|40"
scale="1" scale9grid="" scalechildren="false"
rotate="0"
parent=""
mask=""
onloaded=""
onover=""
onhover="showtext(Change Controlmode, buttonstyle);"
onout=""
ondown=""
onup=""
onclick="action(dragcursor);"
devices="desktop|tablet"
/>

<plugin name="movemode"
url="skin/%SWFPATH%/skin/buttons.png"
keep="true" preload="false"
visible="false" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="0"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="bottom" edge=""
x="+120" y="10" ox="" oy=""
width="40" height="40"
crop="360|0|40|40" ondowncrop="360|80|40|40" onovercrop="360|40|40|40"
scale="1" scale9grid="" scalechildren="false"
rotate="0"
parent=""
mask=""
onloaded=""
onover=""
onhover="showtext(Change Controlmode, buttonstyle);"
onout=""
ondown=""
onup=""
onclick="action(qtvrcursor);"
devices="desktop|tablet"
/>

<plugin name="android_out"
url=""
keep="true" preload="false"
visible="true" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="0"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="leftbottom" edge=""
x="100" y="20" ox="" oy=""
width="" height=""
crop="200|0|40|40" ondowncrop="200|80|40|40" onovercrop="200|40|40|40"
scale="2" scale9grid="" scalechildren="false"
rotate="0"
parent=""
mask=""
onloaded=""
onover=""
onhover=""
onout=""
ondown="set(fov_moveforce,+1);"
onup="set(fov_moveforce,0);"
onclick=""
devices="android"
/>

<plugin name="closefs"
url="skin/%SWFPATH%/skin/buttons.png"
keep="true" preload="false"
visible="false" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="0"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="bottom" edge=""
x="+160" y="10" ox="" oy=""
width="40" height="40"
crop="320|0|40|40" ondowncrop="320|80|40|40" onovercrop="320|40|40|40"
scale="1" scale9grid="" scalechildren="false"
rotate="0"
parent=""
mask=""
onloaded=""
onover=""
onhover="showtext(Exit Fullscreen,buttonstyle);"
onout=""
ondown=""
onup=""
onclick="set(fullscreen,false);"
devices="desktop|tablet"
/>

<plugin name="android_in"
url=""
keep="true" preload="false"
visible="true" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="0"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="leftbottom" edge=""
x="20" y="20" ox="" oy=""
width="" height=""
crop="160|0|40|40" ondowncrop="160|80|40|40" onovercrop="160|40|40|40"
scale="2" scale9grid="" scalechildren="false"
rotate="0"
parent=""
mask=""
onloaded=""
onover=""
onhover=""
onout=""
ondown="set(fov_moveforce,-1);"
onup="set(fov_moveforce,0);"
onclick=""
devices="android"
/>

<plugin name="android_openfs"
url=""
keep="true" preload="false"
visible="true" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="0"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="rightbottom" edge=""
x="20" y="20" ox="" oy=""
width="" height=""
crop="280|0|40|40" ondowncrop="280|80|40|40" onovercrop="280|40|40|40"
scale="2" scale9grid="" scalechildren="false"
rotate="0"
parent=""
mask=""
onloaded=""
onover=""
onhover="showtext(Fullscreen, buttonstyle);"
onout=""
ondown=""
onup=""
onclick="set(fullscreen,true);"
devices="android"
/>

<plugin name="android_closefs"
url=""
keep="true" preload="false"
visible="false" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="0"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="rightbottom" edge=""
x="20" y="20" ox="" oy=""
width="" height=""
crop="320|0|40|40" ondowncrop="320|80|40|40" onovercrop="320|40|40|40"
scale="2" scale9grid="" scalechildren="false"
rotate="0"
parent=""
mask=""
onloaded=""
onover=""
onhover="showtext(Exit Fullscreen,buttonstyle);"
onout=""
ondown=""
onup=""
onclick="set(fullscreen,false);"
devices="android"
/>
<!-- -------------------controlアイコンここまで--------------- -->

10.radarの構文
<!-- --------------------radar------------------- -->
<plugin name="radar"
url="skin/radar.swf"
keep="true" preload="false"
visible="true" enabled="true" handcursor="true" capture="true" children="true" usecontentsize="false"
zorder="0"
alpha="1.00" blendmode="normal" effect="" smoothing="true"
align="rightbottom" edge="center"
x="64" y="64" ox="5" oy=""
width="128" height="128"
crop="" ondowncrop="" onovercrop=""
scale="1" scale9grid="" scalechildren="false"
rotate="270"
parent=""
mask=""
onloaded=""
onover=""
onhover=""
onout=""
ondown=""
onup=""
onclick=""
devices="all"
fillalpha="0.5"
fillcolor="16000000"
heading="0"
linealpha="0.3"
linecolor="16777215"
linewidth="0"
/>
<!-- -------------------ここまで---------------  -->
11.hotspotの定義構文

<!-- --------------------hotspot------------------- -->
<!-- hotspot styles (for Flash and HTML5) -->
<style name="hotspot_ani_black"
url="hotspots/hotspot_ani_black_64x64x20.png"
crop="0|0|64|64"
frames="20" framewidth="64" frameheight="64" frame="0"
onloaded="hotspot_animate();"
altonloaded="if(isphone, mul(scale,2)); onloaded();"
/>

<style name="hotspot_ani_white"
url="hotspots/hotspot_ani_white_64x64x20.png"
crop="0|0|64|64"
frames="20" framewidth="64" frameheight="64" frame="0"
onloaded="hotspot_animate();"
altonloaded="if(isphone, mul(scale,2)); onloaded();"
/>

<action name="hotspot_animate">
inc(frame,1,get(frames),0);
mul(ypos,frame,frameheight);
txtadd(crop,'0|',get(ypos),'|',get(framewidth),'|',get(frameheight));
delayedcall(0.03, hotspot_animate() );
</action>
<!-- ---------------hotspotここまで---------------   -->

12.sceneの中のhotspotの定義
<!-- --------sceneの中のhotspot------------ -->
<!-- place hotspots here -->
<!-- example hotspot:-->
<hotspot name="spot1" style="hotspot_ani_black"
ath="40"
atv="0"
zoom="false"
onclick="looktohotspot(get(name)); loadscene('scene_inuitei2',null,MERGE,BLEND(1));"
/>
<!-- -----sceneの中のhotospotここまで---------- -->
13.サムネールの構文

<!-- ---------------thumbnail構文----------- -->
<!-- thumbnail actions begin (remove the 'buildthumbs()' call in the onstart event to remove the thumbs) -->
<action name="buildthumbs">
if(%1 != NEXT, set(i,0));
if(i LT scene.count,
copy(thumb, scene[get(i)].thumburl);
txtadd(thumbname,'thumb_',get(i));
addplugin(get(thumbname));
set(plugin[get(thumbname)].url, get(thumb));
set(plugin[get(thumbname)].keep, true);
set(plugin[get(thumbname)].align, leftbottom);
set(plugin[get(thumbname)].width, 40);
set(plugin[get(thumbname)].height, 40);
set(plugin[get(thumbname)].x, 10);
set(plugin[get(thumbname)].y, 10);
mul(plugin[get(thumbname)].x, i,3);
mul(plugin[get(thumbname)].y, i,3);
add(plugin[get(thumbname)].x, 5);
add(plugin[get(thumbname)].y, 5);
copy(plugin[get(thumbname)].xsmall, plugin[get(thumbname)].x);
copy(plugin[get(thumbname)].ysmall, plugin[get(thumbname)].y);
add(plugin[get(thumbname)].zorder, 100, i);
set(plugin[get(thumbname)].effect,glow(0xFFFFFF,1.0,2,10000));
set(plugin[get(thumbname)].jsborder,'1px solid #FFFFFF');
copy(plugin[get(thumbname)].thumbpos, i);
set(plugin[get(thumbname)].linkedscene, get(scene[get(i)].name) );
set(plugin[get(thumbname)].onclick, openthumbs() );
inc(i);
buildthumbs(NEXT);
);
</action>

<action name="openthumb">
if(%2 != NEXT,
set(pos,0);
copy(curpos, plugin[%1].thumbpos);
set(xdst, 0);
set(ydst, 0);
);

if(pos LT curpos,
inc(pos);
inc(ydst,90);
sub(ymax, stageheight, 100);
if(ydst GT ymax, inc(xdst,90);set(ydst,0); );
openthumb(%1,NEXT);
,
add(xdst,10);
add(ydst,10);
tween(plugin[%1].x, get(xdst) );
tween(plugin[%1].y, get(ydst) );
tween(plugin[%1].width, 80);
tween(plugin[%1].height, 80);
);
</action>

<action name="closethumb">
tween(plugin[%1].x, get(plugin[%1].xsmall));
tween(plugin[%1].y, get(plugin[%1].ysmall));
tween(plugin[%1].width, 40);
tween(plugin[%1].height, 40);
</action>

<action name="openthumbs">
if(%1 != NEXT,
set(i,0);
set(events.onclick, set(events.onclick,null); delayedcall(0.1, closethumbs() ); );
);

if(i LT scene.count,
txtadd(thumbname,'thumb_',get(i));
openthumb(get(thumbname));
set(plugin[get(thumbname)].onclick, set(events.onclick,null); closethumbs(); loadscene(get(linkedscene),null,MERGE,BLEND(1)); );
inc(i);
openthumbs(NEXT);
);
</action>

<action name="closethumbs">
if(%1 != NEXT, set(i,0));
if(i LT scene.count,
txtadd(thumbname,'thumb_',get(i));
closethumb(get(thumbname));
set(plugin[get(thumbname)].onclick, openthumbs() );
inc(i);
closethumbs(NEXT);
);
</action>
<!-- thumbnail actions end -->
<!-- -------------thumbnail構文---------- -->

14.autorotateの構文
<!-- --------sceneの回転------------ -->
<autorotate enabled ="true"
waittime="1.5"
accel ="1"
speed ="1"
horizon ="0"
tofov ="NaN"
/>
<!-- --------sceneの回転------------ -->
Back